<?php $this->load->view('layout/header'); ?>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]>
</script>
<form name="form1" method="post" action="<?php echo b_url('config/limit_action/').$info['limitid']?>" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">
<div>
</div>
    <div id="container">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_form">
            <tr class="table_form_title">
                <td colspan="4">
                    <span id="lblTitle">添加</span>
                    权限字段
                </td>
            </tr>
            <tr class="table_form_row">
                <td align="right" style="width: 15%">
                    所属父级：
                </td>
                <td>
                    <span id="lblParent">
                        根结点
                        <?php
                            foreach ($node_list as $k => $v) {
                                echo ' > ' . $v['limitfield'] . '  ';
                            }
                        ?>
                    </span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>权限字段名称：
                </td>
                <td>
                    <input name="limitfield" value="<?php echo $info['limitfield']?>" type="text" id="txtLimitField" />
                    <span id="RequiredFieldValidator1" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>权限字段值：
                </td>
                <td>
                    <input name="limitvalue" value="<?php echo $info['limitvalue']?>" type="text" id="txtLimitValue" />
                    <span id="RequiredFieldValidator2" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    设置：
                </td>
                <td>
                    <input id="chkIsDist" type="checkbox" <?php if($info['isdist'] == 0 && !empty($info)){echo 'checked="checked"';}?> value="<?php echo $info['isdist']?>" name="isdist" />
                    <label for="chkIsDist">可分配</label>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>排序号：
                </td>
                <td>
                    <input name="listid" type="text" value="<?php echo $info['listid']?>" id="txtListID" />
                    <span id="RequiredFieldValidator4" style="color:Red;display:none;">不能为空</span>
                    <span id="RegularExpressionValidator1" style="color:Red;display:none;">只能为数字</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    是否关闭：
                </td>
                <td>
                    <span id="radIsClose">
                        <input id="radIsClose_0" type="radio" name="isclose" value="1" <?php if($info['isclose'] == 1){echo 'checked="checked"';}?> /><label for="radIsClose_0">是</label>
                        <input id="radIsClose_1" type="radio" name="isclose" value="0" <?php if($info['isclose'] == 0 || empty($info)){echo 'checked="checked"';}?> /><label for="radIsClose_1">否</label>
                    </span>
                </td>
            </tr>
            <tr class="table_form_btn">
                <td align="right">
                    &nbsp;
                </td>
                <td colspan="3">
                    <input type="submit" value="保存" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;btnSave&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="btnSave" />
                    <input type="button" value="返回" onclick="javascript:history.go(-1);" />
                    <span id="errMsg" style="color:Red;"></span>
                </td>
            </tr>
        </table>
    </div>
    
<script type="text/javascript">
//<![CDATA[
var Page_Validators =  new Array(document.getElementById("RequiredFieldValidator1"), document.getElementById("RequiredFieldValidator2"), document.getElementById("RequiredFieldValidator4"), document.getElementById("RegularExpressionValidator1"));
//]]>
</script>

<script type="text/javascript">
//<![CDATA[
var RequiredFieldValidator1 = document.all ? document.all["RequiredFieldValidator1"] : document.getElementById("RequiredFieldValidator1");
RequiredFieldValidator1.controltovalidate = "txtLimitField";
RequiredFieldValidator1.focusOnError = "t";
RequiredFieldValidator1.errormessage = "不能为空";
RequiredFieldValidator1.display = "Dynamic";
RequiredFieldValidator1.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
RequiredFieldValidator1.initialvalue = "";
var RequiredFieldValidator2 = document.all ? document.all["RequiredFieldValidator2"] : document.getElementById("RequiredFieldValidator2");
RequiredFieldValidator2.controltovalidate = "txtLimitValue";
RequiredFieldValidator2.focusOnError = "t";
RequiredFieldValidator2.errormessage = "不能为空";
RequiredFieldValidator2.display = "Dynamic";
RequiredFieldValidator2.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
RequiredFieldValidator2.initialvalue = "";
var RequiredFieldValidator4 = document.all ? document.all["RequiredFieldValidator4"] : document.getElementById("RequiredFieldValidator4");
RequiredFieldValidator4.controltovalidate = "txtListID";
RequiredFieldValidator4.focusOnError = "t";
RequiredFieldValidator4.errormessage = "不能为空";
RequiredFieldValidator4.display = "Dynamic";
RequiredFieldValidator4.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
RequiredFieldValidator4.initialvalue = "";
var RegularExpressionValidator1 = document.all ? document.all["RegularExpressionValidator1"] : document.getElementById("RegularExpressionValidator1");
RegularExpressionValidator1.controltovalidate = "txtListID";
RegularExpressionValidator1.focusOnError = "t";
RegularExpressionValidator1.errormessage = "只能为数字";
RegularExpressionValidator1.display = "Dynamic";
RegularExpressionValidator1.evaluationfunction = "RegularExpressionValidatorEvaluateIsValid";
RegularExpressionValidator1.validationexpression = "[0-9]{1,}";
//]]>
</script>


<script type="text/javascript">
//<![CDATA[

var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
    ValidatorOnLoad();
}

function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    else {
        return true;
    }
}
        //]]>
</script>
</body>
</html>

